# -*- coding: utf-8 -*-
# File : member_service.py
# Author: taoyahui
# Date : 2021/10/19
from models.create_member import CreateMember
from results import gen_result


def query_member(json_dict):
    page = json_dict['input_page']
    trans_list = CreateMember.query.order_by(CreateMember.pk_id.desc()).paginate(page, per_page=10, error_out=False).items
    trans_list = [item.to_json() for item in trans_list]
    total = CreateMember.query.count()
    return gen_result('200', {
        'total': total,
        'list':trans_list
    })